package com.bridgetree.jubaocrm.ui;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.bridgetree.jubaocrm.R;
import com.bridgetree.jubaocrm.util.Announcement;

/**
 * 公司公告
 */
public class CompanyAnnouncementActivity extends Activity {

	private Context mContext;
	private final String tag = "ViewPageActivity";
	private String ggid;
	private String title;
	private TextView data_tv;
	private TextView TextView01;
	private Button chuli;
	private Button Button01;
	private SharedPreferences prefs;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.company_nnouncement);
		mContext=this;

		Intent intent = getIntent();
		if (intent == null) {
			Log.e(tag, "intent is null");
			return;
		}
		
//		prefs = PreferenceManager.getDefaultSharedPreferences(CompanyAnnouncementActivity.this);
		Announcement mAnnouncement=(Announcement) intent.getExtras().getSerializable("mAnnouncement");
		TextView xm_sp_tv_title = (TextView) findViewById(R.id.xm_sp_tv_title);
		data_tv = (TextView) findViewById(R.id.data_tv);
		TextView01 = (TextView) findViewById(R.id.TextView01);
		chuli = (Button) findViewById(R.id.chuli);
		Button01 = (Button) findViewById(R.id.Button01);
		chuli.setVisibility(View.GONE);
		Button01.setVisibility(View.GONE);
		
		if (intent.getExtras() != null) {
			ggid = intent.getExtras().getString("ggid");
			title = intent.getExtras().getString("title");
		}
		xm_sp_tv_title.setText(mAnnouncement.getTitle());

		findViewById(R.id.xm_sp_RelativeLayout_back).setOnClickListener(
				new OnClickListener() {
					@Override
					public void onClick(View v) {
						finish();
					}
				});
//		if(ggid!=null && !ggid.equals("")){
//			getCompanyGongGao(ggid);
//		}
		
		data_tv.setText(mAnnouncement.getExpire_date());
		TextView01.setText(mAnnouncement.getContent());
	}



}
